<template>
	<view class="p-l-30 p-r-30 p-t-26 p-b-26" >
		<view class="uni-margin-wrap p-b-20" v-if="rotation.length">
		      <swiper class="swiper" circular :indicator-dots="indicatorDots" :autoplay="autoplay" :interval="interval"
		              :duration="duration">
		<!--        <swiper-item v-for="(item, i) in rotation" :key="i" style="width:500px;height:160px;background:url(@/static/banner2.jpg) 0 0 no-repeat;">A
		        </swiper-item>-->
		        <swiper-item v-for="(item, i) in rotation" :key="i" >
		          <image @click="banner_jump(item)" :src="item.image"  style="width:100%;height: 100%;" mode="scaleToFill"></image>
		        </swiper-item>
		      </swiper>
		    </view>
			<Container title="服务手册" class="m-t-50">
				<block v-for="(item, i) in file_list" :key="i">
				<view class="bg box-shadow"  @click="click(item)">
			<view>
				
			  <image v-if="item.type" class="m-t-18" src="@/static/images/user/wailian.svg"  style="width:50px;" mode="widthFix"></image>
			<image v-else class="m-t-18" src="@/static/images/user/pdf.svg"  style="width:50px;" mode="widthFix"></image>
			
			</view>
			<view class="flex-col m-l-20" style="overflow: hidden;">
			  
			  <text style="font-family: PingFangSC-Regular, sans-serif;line-height: 136rpx;" class="opy-6 font-32">
			    {{item.name}}
			    
			  </text></view>
				</view>
				</block>
			</Container>
			
			
			
	</view>
</template>

<script>
	import Container from '@/components/home/Container'
	export default {
		components: {
			Container,
		},
		data() {
			return {
				rotation: [
				  
				],
				file_list:[
					]
			}
		},
		onShow(){
			this.load_file()
		},
		methods: {
			async load_file(){
				console.log(1)
				const res = await this.$api.common.landlord('fileList')
				this.rotation=res.data.banner;
				this.file_list=res.data.file_list;
			},
			click(item) {
				
				if(item.type == 1){
					uni.$u.route(`/pages/webview/index?src=${item.path}`)
				}else{
					uni.$u.route(`/pages/file/file-info?src=${item.path}`)
				}
			},
			banner_jump(item){
				console.log(item.jump)
				if(item.jump){
					
					if(item.path.indexOf('/pages/index')!=-1){
						this.switchTab(item.path)
					}else{
						uni.$u.route(item.path)
					}
				}
			}
		}
	}
</script>

<style>
.bg {
    /*position: relative;
    top: 10px;
    right: 10px;
    color:#808080;
    border-radius: 10px;
    font-size: 14px;
    padding: 5px 15px;*/


    display: flex;
    flex-direction: row;
    //justify-content: center;
    height: 136rpx;
    padding: 0rpx 20rpx;
    border-radius: 16rpx;
    margin-bottom: 15rpx;
    margin-top: 15rpx;
    position: relative;
    background: #fff;
    font-weight: bold;
    box-shadow: 0px 2px 16px 0px rgba(0,0,0,0.1);
		//background: url(@/static/images/user/bg_zichan_moni_hui_2@2x.png) 0 0 no-repeat;
		//background-size: 100% 100%;
	}
</style>
